home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / falcon / nt_dsp2.lzh / NT_DSP2.MSA / BENCH / 6-96 < prev    next >
Encoding:
Text File  |  1988-07-19  |  4.0 KB  |  102 lines

  1.     page 132,66,0,6
  2.         opt     rc
  3. ;*******************************************
  4. ;Motorola Austin DSP Operation  June 30,1988
  5. ;*******************************************
  6. ;DSP96001/2
  7. ;8 pole cascaded transpose IIR filter
  8. ;File name: 6-96.asm
  9. ;**************************************************************************
  10. ;    Maximum sample rate: 421.9 KHz at 27.0 MHz
  11. ;    Memory Size: Prog: 6+14 words ; Data :4*(2+5) words
  12. ;    Number of clock cycles:    64 (32 instruction cycles)
  13. ;    Clock Frequency:    27.0 MHz
  14. ;    Cycle time:        74.1 ns
  15. ;**************************************************************************
  16. ;    This IIR filter reads the input sample
  17. ;    from the memory location Y:input
  18. ;    and writes the filtered output sample
  19. ;    to the memory location Y:output
  20. ;
  21. ;    The samples are stored in the X memory
  22. ;    The coefficients are stored in the Y memory
  23. ;**************************************************************************
  24. ;
  25. ;    initialization
  26. ;**********************
  27. nsec    equ    4
  28. start    equ    $40
  29. w1    equ     0    ;w1,...
  30. w2    equ     8    ;w2,...
  31. cddr    equ     0    ;b0,b1,a1,b2,a2
  32. input    equ    $ffe0
  33. output    equ    $ffe1
  34. ;
  35. ;The cascaded transpose IIR filter has a filter section:
  36. ;
  37. ;
  38. ;    x  --------------bi0---->(+)--------------------> y
  39. ;                |             ^            |
  40. ;                |             | w1         |
  41. ;                |            1/z           |
  42. ;                |             |            |
  43. ;                |----bi1---->(+)<---ai1----|
  44. ;                |             ^            |
  45. ;                |             | w2         |
  46. ;                |            1/z           |
  47. ;                |             |            |
  48. ;                |----bi2---->(+)<---ai2----|
  49. ;
  50. ;The filter equations are:
  51. ;    y  = x*bi0 + w1
  52. ;    w1 = x*bi1 + y*ai1 + w2
  53. ;    w2 = x*bi2 + y*a2
  54. ;
  55. ;
  56. ;              Cascaded Transpose IIR Filter              Program  Icycles
  57. ;                                                          Words
  58.     move    #coef,r0        ;point to coefficients      ;    1     1
  59.     move    #w1,r4          ;point to w1          ;    1     1
  60.     move    #w2,r5          ;point to w2          ;    1     1
  61.  
  62.     move    #5*nsec-1,m0    ;mod 5*nsec on coefficients      ;    1     1
  63.     move    #nsec-1,m4      ;mod nsec on w1          ;    1     1
  64.     move    #nsec,m5        ;mod nsec+1 on w2          ;    1     1
  65.                               ;  ----   ----
  66. ;    filter loop: 5*nsec+12                      6        6
  67. ;*******************************************
  68.     fmovep  y:input,d7.l    ;get input x          ;    1     2
  69.     float   d7,d7                                         ;    1     1
  70.     fmove   x:(r0)+,d6.s    ;load b0                      ;    1     1
  71. ;
  72.     do      #nsec,fltend    ;do filter                    ;    2     3
  73. ;         x*b0       b2*x+a2*y           b1            w1       
  74.     fmpy  d7,d6,d0  faddr d0,d1  x:(r0)+,d6.s  y:(r4),d2.s ;   1     1
  75.                                     
  76. ;         x*b1       y=x*b0+w1           a1            w2 
  77.     fmpy  d7,d6,d0  faddr d0,d2  x:(r0)+,d6.s  y:(r5),d3.s ;   1     1
  78.  
  79. ;         y*a1       x*b1+w2             b2     new w2
  80.     fmpy  d2,d6,d0  fadd  d0,d3  x:(r0)+,d6.s  d1.s,y:(r5)+ ;  1     1
  81.  
  82. ;         x*b2     w1'=x*b1+w2+y*a1      a2    y->x
  83.     fmpy  d7,d6,d0  faddr d0,d3  x:(r0)+,d6.s  d2.s,d7.s    ;  1     1
  84.  
  85. ;         y*a2                           b0     w1
  86.     fmpy  d2,d6,d1               x:(r0)+,d6.s  d3.s,y:(r4)+ ;  1     1
  87. fltend
  88.  
  89. ;                   b2*x+a2*y   point back to b0
  90.                     faddr d0,d1    (r0)-                    ;  1     1
  91.  
  92. ;                                              save last w2
  93.     fmove                                      d1.s,y:(r5)+ ;  1     1
  94.     int    d2,d2                                            ;  1     1
  95.     fmovep d2.l,y:output                    ;  1     2
  96.                                                             ; ---   ---
  97.                                                             ; 14    32 
  98.                                                             ;     5*nsec+12
  99.                                                  ;   TOTAL    20  5*nsec+18
  100.     end
  101.  
  102.